<!--#include file="inc/AspCms_SettingClass.asp" -->
<%CheckLogin()%>
<%
	dim sql,rs
%>
<!DOCTYPE html>
<html lang="zh-CN" style="min-height: 100%; background: #1f7ed0;">
<head>
<title>Menu</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />

<link href="css/timoo/uikit.min.css" rel="stylesheet">
<link href="css/timoo/timoo.css" rel="stylesheet">

<script src="js/timoo/jquery.min.js"></script>
<script src="js/timoo/uikit.min.js"></script>
<script src="js/timoo/uikit-icons.min.js"></script>
<script src="js/timoo/timoo.js"></script>
</head>

<script>
function getObject(objectId) {
    if(document.getElementById && document.getElementById(objectId)) {
        // W3C DOM
        return document.getElementById(objectId);
    } else if (document.all && document.all(objectId)) {
        // MSIE 4 DOM
        return document.all(objectId);
    } else if (document.layers && document.layers[objectId]) {
        // NN 4 DOM.. note: this won't find nested layers
        return document.layers[objectId];
    } else {
        return false;
    }
}

function showHide(objname){
    var obj = getObject(objname);
    if(obj.style.display == "none"){
		obj.style.display = "block";
	} else {
		obj.style.display = "none";
	}
}
</script>
<base target="main">
<body>
<div class="tm-left">
<div class="main">
    <div class="menu">
        <div class="title">
            <a href="###" onclick="showHide('items0');" target="_self">
                <i uk-icon="icon: cog;"></i>
                <%=conn.exec("select MenuName from {prefix}Menu where MenuID="&getForm("id","get"),"r1")(0)%>
            </a>
        </div>
        <div class="menu-list">
            <ul>
                <%
                    dim menuid : menuid = getForm("id","get")
                    dim src : src = getForm("src","get")
                    dim i,firstLink,SceneStr
                   
                    if not isnul(session("SceneMenu")) then 
                        SceneStr = " and MenuID in("&session("SceneMenu")&")"
                    end if

                    if session("GroupMenu")="all" then
	                    sql = "select MenuID, MenuName, MenuLink from {prefix}Menu where MenuStatus=1 and ParentID="&menuid&" "&SceneStr&"  order by MenuOrder"
                    else
	                    sql = "select MenuID, MenuName, MenuLink from {prefix}Menu where MenuStatus=1 and ParentID="&menuid&" and MenuID in("&session("GroupMenu")&") "&SceneStr&"  order by MenuOrder"
                    end if

                    set rs = conn.exec(sql, "r1")

                    i = 1
                    do while not rs.eof 
	                    if i = 1 then firstLink=rs(2)
	                        echo "<li><a href='"&rs(2)&"' target='main'><i uk-icon=""icon: nut;""></i>"&rs(1)&"</a></li>"
	                    rs.moveNext
	                    i = i+1
                    loop
                    rs.close : set rs = nothing
                    if not isnul(src) then firstLink = src
                %> 
            </ul>
        </div>
    </div>
</div>

<Script>top.document.getElementById("main").src = '<%=firstLink%>';</Script>
</div>

</body>
</html>
